/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com
 @idle games : http://www.gityx.com
 @QQ Group : 627141737

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //未分类：
    'Save': '保存',
    'Export': '导出',
    'Import': '导入',
    'Settings': '设置',
    'Achievements': '成就',
    'Statistics': '统计',
    'Changelog': '更新日志',
    'Hotkeys': '快捷键',
    'ALL': '全部',
    'Default': '默认',
    'AUTO': '自动',
    'default': '默认',
    "points": "点数",
    "Reset for +": "重置得到 + ",
    "Currently": "当前",
    "Effect": "效果",
    "Cost": "成本",
    "Goal:": "目标:",
    "Reward": "奖励",
    "Start": "开始",
    "Exit Early": "提前退出",
    "Finish": "完成",
    "Milestone Gotten!": "获得里程碑！",
    "Milestones": "里程碑",
    "Completed": "已完成",
    "Achievement Gotten!": "成就达成！",
    "Coins": "金币",
    "Reset Diamond & Coin layers for +1.00% Accelerator power & 5 free Accelerator": "重置钻石和金币层以获得 +1.00% 加速器功率和 5 免费加速器",
    "Coin upgrades": "金币升级",
    "Autobuy Accelerators once per tick": "自动购买 加速器 一次/tick",
    "Autobuy Alchemies once per tick": "每刻自动购买 炼金术 一次/tick",
    "Autobuy Coin Mints once per tick": "自动购买 铸币厂 一次/tick",
    "Autobuy Investments once per tick": "自动购买 投资 一次/tick",
    "Autobuy Multipliers once per tick": "自动购买 乘数 一次/tick",
    "Autobuy Printers once per tick": "自动购买 印钞机 一次/tick",
    "Autobuy Workers once per tick": "自动购买 工人 一次/tick",
    "Buildings": "建筑物",
    "Diamond upgrades": "钻石升级",
    "Diamonds": "钻石",
    "Reset for": "重置获得 ",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",

    //树游戏
    'Loading...': '加载中...',
    'ALWAYS': '一直',
    'HARD RESET': '硬重置',
    'Export to clipboard': '导出到剪切板',
    'INCOMPLETE': '不完整',
    'HIDDEN': '隐藏',
    'AUTOMATION': '自动',
    'NEVER': '从不',
    'ON': '打开',
    'OFF': '关闭',
    'SHOWN': '显示',
    'Play Again': '再次游戏',
    'Keep Going': '继续',
    'The Modding Tree Discord': '模型树Discord',
    'You have': '你有',
    'It took you {{formatTime(player.timePlayed)}} to beat the game.': '花费了 {{formatTime(player.timePlayed)}} 时间去通关游戏.',
    'Congratulations! You have reached the end and beaten this game, but for now...': '恭喜你！ 您已经结束并通关了本游戏，但就目前而言...',
    'Main Prestige Tree server': '主声望树服务器',
    'Reach {{formatWhole(ENDGAME)}} to beat the game!': '达到 {{formatWhole(ENDGAME)}} 去通关游戏!',
    "Loading... (If this takes too long it means there was a serious error!": "正在加载...（如果这花费的时间太长，则表示存在严重错误！",
    'Loading... (If this takes too long it means there was a serious error!)←': '正在加载...（如果时间太长，则表示存在严重错误！）←',
    'Main\n\t\t\t\tPrestige Tree server': '主\n\t\t\t\t声望树服务器',
    'The Modding Tree\n\t\t\t\t\t\t\tDiscord': '模型树\n\t\t\t\t\t\t\tDiscord',
    'Please check the Discord to see if there are new content updates!': '请检查 Discord 以查看是否有新的内容更新！',
    'aqua': '水色',
    'AUTOMATION, INCOMPLETE': '自动化，不完整',
    'LAST, AUTO, INCOMPLETE': '最后，自动，不完整',
    'NONE': '无',
    'P: Reset for': 'P: 重置获得',
    'Git游戏': 'Git游戏',
    'QQ群号': 'QQ群号',
    'My discord server': '我的 discord 服务器',
    '': '',
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "(-": "(-",
    "(+": "(+",
    "(": "(",
    "-": "-",
    "+": "+",
    " ": " ",
    ": ": "： ",
    "\n": "",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    //树游戏
    "\t\t\t": "\t\t\t",
    "\n\n\t\t": "\n\n\t\t",
    "\n\t\t": "\n\t\t",
    "Show Milestones: ": "显示里程碑：",
    "Autosave: ": "自动保存: ",
    "Offline Prod: ": "离线生产: ",
    "Completed Challenges: ": "完成的挑战: ",
    "High-Quality Tree: ": "高质量树贴图: ",
    "Offline Time: ": "离线时间: ",
    "Theme: ": "主题: ",
    "Anti-Epilepsy Mode: ": "抗癫痫模式：",
    "In-line Exponent: ": "直列指数：",
    "Single-Tab Mode: ": "单标签模式：",
    "Time Played: ": "已玩时长：",
    "Shift-Click to Toggle Tooltips: ": "Shift-单击以切换工具提示：",
    "Acceleration Power: ": "加速功率：",
    "Acceleration: ": "加速：",
    "Accelerator Boost: ": "加速器提升：",
    "Accelerators: ": "加速器：",
    "Alchemies: ": "炼金术：",
    "Coin Mints: ": "铸币厂：",
    "Coins/Sec: ": "金币/秒: ",
    "Investments: ": "投资：",
    "Multiplier Power: ": "乘数功率：",
    "Multiplier: ": "乘数：",
    "Multipliers: ": "乘数：",
    "Printers: ": "印钞机：",
    "Workers: ": "工人: ",
    "Effect: Alchemy production x": "效果：炼金术生产 x",
    "Effect: Coin Mint production x": "效果：铸币厂生产 x",
    "Effect: Investment production x": "效果：投资生产 x",
    "Effect: Printer production x": "效果：印钞机生产 x",
    "Effect: Worker production x": "效果：工人生产 x",
    "Pandoras Boxes: ": "潘多拉魔盒：",
    "Pickaxes: ": "镐：",
    "Pickaxes/Sec: ": "镐/秒：",
    "Plants/Sec: ": "植物/秒：",
    "Ref./Sec: ": "精炼/秒：",
    "Refineries: ": "精炼厂：",
    "Rigs/Sec: ": "钻机/秒：",
    "Coal Plants: ": "煤厂：",
    "Coal Rigs: ": "煤炭钻机：",
    "Crystals/Sec: ": "水晶/秒：",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需处理的后缀
var cnPostfix = {
    ":": "：",
    "：": "：",
    ": ": "： ",
    "： ": "： ",
    "/s)": "/s)",
    "/s": "/s",
    ")": ")",
    "%": "%",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": " ",
    "\n": "",
    "\n\t\t\t": "\n\t\t\t",
    "\t\t\n\t\t": "\t\t\n\t\t",
    "\t\t\t\t": "\t\t\t\t",
    "\n\t\t": "\n\t\t",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^(\d+)$/,
    /^\s*$/, //纯空格
    /^([\d\.]+)e(\d+)$/,
    /^([\d\.]+)$/,
    /^([\d\.]+) \[\+([\d\.]+)\]$/,
    /^([\d\.]+) \[([\d\.]+)\%\]$/,
    /^([\d\.,]+) \[([\d\.]+)\%\]$/,
    /^([\d\.]+)e([\d\.,]+) \[([\d\.]+)\%\]$/,
    /^([\d\.]+) K$/,
    /^([\d\.]+) M$/,
    /^([\d\.]+) B$/,
    /^([\d\.]+)s$/,
    /^([\d\.]+)x$/,
    /^x([\d\.]+)$/,
    /^([\d\.,]+)$/,
    /^([\d\.,]+)x$/,
    /^x([\d\.,]+)$/,
    /^([\d\.]+)e([\d\.,]+)$/,
    /^x([\d\.]+)e([\d\.,]+)$/,
    /^([\d\.]+)e([\d\.,]+)x$/,
    /^[\u4E00-\u9FA5]+$/
];
var cnExcludePostfix = [
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
//换行加空格：\n(.+)
var cnRegReplace = new Map([
    [/^([\d\.]+) hours ([\d\.]+) minutes ([\d\.]+) seconds$/, '$1 小时 $2 分钟 $3 秒'],
    [/^You are gaining (.+) elves per second$/, '你每秒获得 $1 精灵'],
    [/^Reach (.+) Coins to unlock$/, '达到 $1 金币即可解锁'],
    [/^Reach (.+) Coins to unlock \(You have (.+) Coins$/, '达到 $1 金币即可解锁（您有 $2 金币'],
    [/^You have (.+) Crystals, multiplying Coin production by (.+)$/, '您有 $1 水晶，将硬币产量 x$2'],
    [/^You have (.+) points$/, '你有 $1 点数'],
    [/^You have (.+) Quarks!$/, '你有 $1 夸克!'],
    [/^Next at (.+) Coins$/, '下一个在 $1 金币'],
    [/^Next at (.+) points$/, '下一个在 $1 点数'],
    [/^Effect: \+(.+) Mulitpliers \& \+(.+) Accelerators$/, '效果：\+$1 乘数 \& \+$2 加速器'],
	[/^([\d\.]+)\/sec$/, '$1\/秒'],
	[/^([\d\.,]+)\/sec$/, '$1\/秒'],
	[/^([\d\.,]+) OOMs\/sec$/, '$1 OOMs\/秒'],
	[/^([\d\.]+) OOMs\/sec$/, '$1 OOMs\/秒'],
	[/^([\d\.]+)e([\d\.,]+)\/sec$/, '$1e$2\/秒'],
    [/^requires ([\d\.]+) more research points$/, '需要$1个研究点'],
    [/^([\d\.]+)e([\d\.,]+) points$/, '$1e$2 点数'],
    [/^([\d\.]+) elves$/, '$1 精灵'],
    [/^([\d\.]+)e([\d\.,]+) Coins$/, '$1e$2 金币'],
    [/^([\d\.]+)e([\d\.,]+) Diamonds$/, '$1e$2 钻石'],
    [/^([\d\.,]+) Coins$/, '$1 金币'],
    [/^([\d\.,]+) Diamonds$/, '$1 钻石'],
    [/^\*(.+) to electricity gain$/, '\*$1 到电力增益'],
    [/^Cost: ([\d\.,]+)$/, '成本：$1'],
    [/^Cost: ([\d\.]+)e([\d\.,]+)$/, '成本：$1e$2'],
    [/^Cost: (.+) points$/, '成本：$1 点数'],
    [/^Cost: (.+) Diamonds$/, '成本：$1 钻石'],
    [/^Cost: (.+) Coins$/, '成本：$1 金币'],
    [/^Goal: Get (.+) Worker$/, '目标：获得 $1 工人'],
    [/^Goal: Get (.+) Workers$/, '目标：获得 $1 工人'],
    [/^Goal: Get (.+) Printer$/, '目标：获得 $1 印钞机'],
    [/^Goal: Get (.+) Printers$/, '目标：获得 $1 印钞机'],
    [/^Goal: Get (.+) Alchemy$/, '目标：获得 $1 炼金术'],
    [/^Goal: Get (.+) Alchemys$/, '目标：获得 $1 炼金术'],
    [/^Goal: Get (.+) Coin Mint$/, '目标：获得 $1 铸币厂'],
    [/^Goal: Get (.+) Coin Mints$/, '目标：获得 $1 铸币厂'],
    [/^Goal: Get (.+) Investment$/, '目标：获得 $1 投资'],
    [/^Goal: Get (.+) Investments$/, '目标：获得 $1 投资'],
    [/^Reward: (.+) Quark$/, '奖励：$1 夸克'],
    [/^Require: (.+) Coins$/, '需要：$1 金币'],
    [/^Req: (.+) \/ (.+) elves$/, '成本：$1 \/ $2 精灵'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);